def sort1(a):
    return a['age']


classes = [
        {"name": "abyss", "age": 25, "grade": "A"},
        {"name": "kin", "age": 23, "grade": "B"},
        {"name": "tian", "age": 24, "grade": "B"},
        {"name": "hun", "age": 26, "grade": "A"},
        {"name": "exe", "age": 21, "grade": "A"}
        ]

classes.sort(key=sort1)
print(classes)

classes.sort(key=lambda x: x['age'])
print(classes)


def add(b):
    b['age'] = b['age'] + 1
    return b


classes1 = map(add, classes)
print(list(classes1))

classes2 = filter(lambda x: x['grade'] != 'A', classes)
print(list(classes2))


def fei(n):
    if n == 0:
        return 0
    return n*fei(n-1)



